package com.lishui.waterojbackenduserservice.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lishui.waterojbackendmodel.model.pojo.dto.UserLoginDTO;
import com.lishui.waterojbackendmodel.model.pojo.dto.UserRegisterDTO;
import com.lishui.waterojbackendmodel.model.pojo.dto.UserUpdateDTO;
import com.lishui.waterojbackendmodel.model.pojo.entity.User;
import com.lishui.waterojbackendmodel.model.pojo.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 用户服务
 */
public interface UserService extends IService<User> {

    /**
     * 用户注册
     */
    long userRegister(UserRegisterDTO userRegisterDTO);

    /**
     * 用户登录
     * @return
     */
    UserVO userLogin(UserLoginDTO userLoginDTO, HttpServletRequest request);

    /**
     * 用户注销
     *
     * @param request
     * @return
     */
    void userLogout(HttpServletRequest request);

    List<UserVO> searchUsers(String username);

    boolean isAdmin(Long userId);

    void update(UserUpdateDTO userUpdateDTO, HttpServletRequest httpServletRequest);

    UserVO getCurrentUser(HttpServletRequest httpServletRequest);
}
